﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="page.ascx.cs" Inherits="admin_page" %>
<center>
<table width="100%">
    <tr>
        <td>ID: </td>
        <td>
            <asp:TextBox ID="id" runat="server"></asp:TextBox>
            </td>
    </tr>
    <tr>
        <td>Ngôn ngữ: </td>
        <td>
            <asp:TextBox ID="lang" runat="server"></asp:TextBox>
            </td>
    </tr>
    <tr>
        <td>Trang: </td>
        <td>
            <asp:TextBox ID="pages" runat="server"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td>Menu: </td>
        <td>
            <asp:TextBox ID="menu" runat="server"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td>Miêu tả: </td>
        <td>
            <asp:TextBox ID="des" runat="server" Height="62px" Width="226px"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td>Index: </td>
        <td>
            <asp:TextBox ID="index" runat="server"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td colspan="2"><center><asp:Button runat="server" ID="addbt" Text="Thêm"/></center></td>
    </tr>
</table>
</center>
<br />
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" AllowSorting="True"
        CellPadding="4" ForeColor="#333333" GridLines="None"
        PageSize="5" Width="100%" onrowcreated="GridView1_RowCreated" 
        onrowediting="GridView1_RowEditing" 
    onrowcommand="GridView1_RowCommand" 
    DataSourceID="SqlDataSource1" DataKeyNames="id,lang">
        <RowStyle BackColor="#EFF3FB" VerticalAlign="Middle" />
        <EmptyDataRowStyle VerticalAlign="Middle" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="White" ForeColor="#459300" HorizontalAlign="Center" />
        <EmptyDataTemplate>
             <asp:Label ID="Label3" runat="server" Text="Chưa có dữ liệu"></asp:Label>
        </EmptyDataTemplate>
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <HeaderStyle BackColor="#57A000" Font-Bold="True" ForeColor="White" />
        <Columns>
            <asp:TemplateField HeaderText="ID" SortExpression="id" ItemStyle-HorizontalAlign="Center">
                <EditItemTemplate>
                    <asp:Label ID="id" runat="server" Text='<%# Eval("id") %>'></asp:Label>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="id" runat="server" Text='<%# Bind("id") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="lang" HeaderText="Ngôn ngữ" 
                SortExpression="lang" ItemStyle-HorizontalAlign="Center" ReadOnly="True" />
            <asp:BoundField DataField="page" HeaderText="Trang" 
                SortExpression="page" ItemStyle-HorizontalAlign="Center"/>
            <asp:BoundField DataField="menu" HeaderText="Menu" SortExpression="menu" ItemStyle-HorizontalAlign="Center"/>
            <asp:BoundField DataField="description" HeaderText="Miêu tả" 
                SortExpression="description" ItemStyle-HorizontalAlign="Center"/>
            <asp:BoundField DataField="index" HeaderText="Index" 
                SortExpression="index" ItemStyle-HorizontalAlign="Center"/>
            <asp:CommandField ButtonType="Button" EditText="Sửa" ShowEditButton="True" ItemStyle-HorizontalAlign="Center"/>
            <asp:CommandField ButtonType="Button" DeleteText="Xoá" 
                ShowDeleteButton="True" ItemStyle-HorizontalAlign="Center"/>
        </Columns>
        <EditRowStyle BackColor="#003366" VerticalAlign="Middle" />
        <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:canhbuomxanhconnectionstring %>" 
    SelectCommand="SELECT * FROM [Page]">
</asp:SqlDataSource>